Integrand size = 42, antiderivative size = 86 \[ \int \frac {B \cos (c+d x)+C \cos ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x) (a+b \cos (c+d x))} \, dx=-\frac {2 B E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{a d}-\frac {2 (b B-a C) \operatorname {EllipticPi}\left (\frac {2 b}{a+b},\frac {1}{2} (c+d x),2\right )}{a (a+b) d}+\frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}} \]
-2*B*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin(1/2*d*x +1/2*c),2^(1/2))/a/d-2*(B*b-C*a)*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+ 1/2*c)*EllipticPi(sin(1/2*d*x+1/2*c),2*b/(a+b),2^(1/2))/a/(a+b)/d+2*B*sin( d*x+c)/a/d/cos(d*x+c)^(1/2)
Leaf count is larger than twice the leaf count of optimal. \(206\) vs. \(2(86)=172\).
Time = 2.68 (sec) , antiderivative size = 206, normalized size of antiderivative = 2.40 \[ \int \frac {B \cos (c+d x)+C \cos ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x) (a+b \cos (c+d x))} \, dx=\frac {\frac {2 (-3 b B+2 a C) \operatorname {EllipticPi}\left (\frac {2 b}{a+b},\frac {1}{2} (c+d x),2\right )}{a+b}-\frac {2 a B \left (2 \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )-\frac {2 a \operatorname {EllipticPi}\left (\frac {2 b}{a+b},\frac {1}{2} (c+d x),2\right )}{a+b}\right )}{b}+\frac {4 B \sin (c+d x)}{\sqrt {\cos (c+d x)}}-\frac {2 B \left (-2 a b E\left (\left .\arcsin \left (\sqrt {\cos (c+d x)}\right )\right |-1\right )+2 a (a+b) \operatorname {EllipticF}\left (\arcsin \left (\sqrt {\cos (c+d x)}\right ),-1\right )+\left (-2 a^2+b^2\right ) \operatorname {EllipticPi}\left (-\frac {b}{a},\arcsin \left (\sqrt {\cos (c+d x)}\right ),-1\right )\right ) \sin (c+d x)}{a b \sqrt {\sin ^2(c+d x)}}}{2 a d} \]
((2*(-3*b*B + 2*a*C)*EllipticPi[(2*b)/(a + b), (c + d*x)/2, 2])/(a + b) - (2*a*B*(2*EllipticF[(c + d*x)/2, 2] - (2*a*EllipticPi[(2*b)/(a + b), (c + d*x)/2, 2])/(a + b)))/b + (4*B*Sin[c + d*x])/Sqrt[Cos[c + d*x]] - (2*B*(-2 *a*b*EllipticE[ArcSin[Sqrt[Cos[c + d*x]]], -1] + 2*a*(a + b)*EllipticF[Arc Sin[Sqrt[Cos[c + d*x]]], -1] + (-2*a^2 + b^2)*EllipticPi[-(b/a), ArcSin[Sq rt[Cos[c + d*x]]], -1])*Sin[c + d*x])/(a*b*Sqrt[Sin[c + d*x]^2]))/(2*a*d)
Time = 0.79 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 3508, 3042, 3479, 27, 3042, 3538, 25, 27, 3042, 3119, 3284}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {B \cos (c+d x)+C \cos ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x) (a+b \cos (c+d x))} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right )^{5/2} \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )}dx\) |
\(\Big \downarrow \) 3508 |
\(\displaystyle \int \frac {B+C \cos (c+d x)}{\cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {B+C \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^{3/2} \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )}dx\) |
\(\Big \downarrow \) 3479 |
\(\displaystyle \frac {2 \int -\frac {b B \cos ^2(c+d x)+a B \cos (c+d x)+b B-a C}{2 \sqrt {\cos (c+d x)} (a+b \cos (c+d x))}dx}{a}+\frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}}-\frac {\int \frac {b B \cos ^2(c+d x)+a B \cos (c+d x)+b B-a C}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))}dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}}-\frac {\int \frac {b B \sin \left (c+d x+\frac {\pi }{2}\right )^2+a B \sin \left (c+d x+\frac {\pi }{2}\right )+b B-a C}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )} \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )}dx}{a}\) |
\(\Big \downarrow \) 3538 |
\(\displaystyle \frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}}-\frac {B \int \sqrt {\cos (c+d x)}dx-\frac {\int -\frac {b (b B-a C)}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))}dx}{b}}{a}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}}-\frac {\frac {\int \frac {b (b B-a C)}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))}dx}{b}+B \int \sqrt {\cos (c+d x)}dx}{a}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}}-\frac {(b B-a C) \int \frac {1}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))}dx+B \int \sqrt {\cos (c+d x)}dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}}-\frac {(b B-a C) \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )} \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )}dx+B \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}dx}{a}\) |
\(\Big \downarrow \) 3119 |
\(\displaystyle \frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}}-\frac {(b B-a C) \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )} \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )}dx+\frac {2 B E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}}{a}\) |
\(\Big \downarrow \) 3284 |
\(\displaystyle \frac {2 B \sin (c+d x)}{a d \sqrt {\cos (c+d x)}}-\frac {\frac {2 (b B-a C) \operatorname {EllipticPi}\left (\frac {2 b}{a+b},\frac {1}{2} (c+d x),2\right )}{d (a+b)}+\frac {2 B E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}}{a}\) |
-(((2*B*EllipticE[(c + d*x)/2, 2])/d + (2*(b*B - a*C)*EllipticPi[(2*b)/(a + b), (c + d*x)/2, 2])/((a + b)*d))/a) + (2*B*Sin[c + d*x])/(a*d*Sqrt[Cos[ c + d*x]])
3.9.81.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)* (c - Pi/2 + d*x), 2], x] /; FreeQ[{c, d}, x]
Int[1/(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])*Sqrt[(c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]]), x_Symbol] :> Simp[(2/(f*(a + b)*Sqrt[c + d]))*EllipticPi[ 2*(b/(a + b)), (1/2)*(e - Pi/2 + f*x), 2*(d/(c + d))], x] /; FreeQ[{a, b, c , d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[c + d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si mp[(-(A*b^2 - a*b*B))*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1)*((c + d*Sin [e + f*x])^(1 + n)/(f*(m + 1)*(b*c - a*d)*(a^2 - b^2))), x] + Simp[1/((m + 1)*(b*c - a*d)*(a^2 - b^2)) Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[(a*A - b*B)*(b*c - a*d)*(m + 1) + b*d*(A*b - a*B)*(m + n + 2) + (A*b - a*B)*(a*d*(m + 1) - b*c*(m + 2))*Sin[e + f*x] - b*d*(A*b - a*B) *(m + n + 3)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n }, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && Rat ionalQ[m] && m < -1 && ((EqQ[a, 0] && IntegerQ[m] && !IntegerQ[n]) || !(I ntegerQ[2*n] && LtQ[n, -1] && ((IntegerQ[n] && !IntegerQ[m]) || EqQ[a, 0]) ))
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_ .) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b^2 Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*(b*B - a*C + b*C*Sin[e + f*x]), x], x] /; FreeQ [{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^ 2)/(Sqrt[(a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])), x_Symbol] :> Simp[C/(b*d) Int[Sqrt[a + b*Sin[e + f*x]], x] , x] - Simp[1/(b*d) Int[Simp[a*c*C - A*b*d + (b*c*C - b*B*d + a*C*d)*Sin[ e + f*x], x]/(Sqrt[a + b*Sin[e + f*x]]*(c + d*Sin[e + f*x])), x], x] /; Fre eQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0 ] && NeQ[c^2 - d^2, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(299\) vs. \(2(136)=272\).
Time = 5.49 (sec) , antiderivative size = 300, normalized size of antiderivative = 3.49
method | result | size |
default | \(-\frac {\sqrt {-\left (-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (\frac {2 B \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \left (2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{a \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right )}-\frac {4 \left (-B b +a C \right ) b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, \Pi \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), -\frac {2 b}{a -b}, \sqrt {2}\right )}{a \left (-2 a b +2 b^{2}\right ) \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(300\) |
-(-(-2*cos(1/2*d*x+1/2*c)^2+1)*sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*B/a/sin(1/2* d*x+1/2*c)^2/(2*sin(1/2*d*x+1/2*c)^2-1)*(-2*sin(1/2*d*x+1/2*c)^4+sin(1/2*d *x+1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2*cos(1/2*d*x+1/2*c)-(sin(1/2*d*x +1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticE(cos(1/2*d*x+1/ 2*c),2^(1/2)))-4/a*(-B*b+C*a)/(-2*a*b+2*b^2)*b*(sin(1/2*d*x+1/2*c)^2)^(1/2 )*(-2*cos(1/2*d*x+1/2*c)^2+1)^(1/2)/(-2*sin(1/2*d*x+1/2*c)^4+sin(1/2*d*x+1 /2*c)^2)^(1/2)*EllipticPi(cos(1/2*d*x+1/2*c),-2*b/(a-b),2^(1/2)))/sin(1/2* d*x+1/2*c)/(2*cos(1/2*d*x+1/2*c)^2-1)^(1/2)/d
Timed out. \[ \int \frac {B \cos (c+d x)+C \cos ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x) (a+b \cos (c+d x))} \, dx=\text {Timed out} \]
integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)/cos(d*x+c)^(5/2)/(a+b*cos(d*x+c)), x, algorithm="fricas")
Timed out. \[ \int \frac {B \cos (c+d x)+C \cos ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x) (a+b \cos (c+d x))} \, dx=\text {Timed out} \]
\[ \int \frac {B \cos (c+d x)+C \cos ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x) (a+b \cos (c+d x))} \, dx=\int { \frac {C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )}{{\left (b \cos \left (d x + c\right ) + a\right )} \cos \left (d x + c\right )^{\frac {5}{2}}} \,d x } \]
integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)/cos(d*x+c)^(5/2)/(a+b*cos(d*x+c)), x, algorithm="maxima")
\[ \int \frac {B \cos (c+d x)+C \cos ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x) (a+b \cos (c+d x))} \, dx=\int { \frac {C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )}{{\left (b \cos \left (d x + c\right ) + a\right )} \cos \left (d x + c\right )^{\frac {5}{2}}} \,d x } \]
integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)/cos(d*x+c)^(5/2)/(a+b*cos(d*x+c)), x, algorithm="giac")
Timed out. \[ \int \frac {B \cos (c+d x)+C \cos ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x) (a+b \cos (c+d x))} \, dx=\int \frac {C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )}{{\cos \left (c+d\,x\right )}^{5/2}\,\left (a+b\,\cos \left (c+d\,x\right )\right )} \,d x \]